export default (phone) => {
  const cm = '134,135,136,137,138,139,147,150,151,152,157,158,159,165,172,178,182,183,184,187,188,195,198';
  const cu = '130,131,132,145,146,155,156,166,171,175,176,185,186';
  const ct = '133,149,153,173,174,177,180,181,189,191,193,199';
  const vt = '170';
  const v = phone || '';
  const h1 = v.substring(0, 3);
  const h2 = v.substring(0, 4);
  const x = /^1\d{10}$/.test(v)
    ? cu.indexOf(h1) >= 0
      ? '联通'
      : ct.indexOf(h1) >= 0
      ? '电信'
      : h2 === '1349'
      ? '电信'
      : cm.indexOf(h1) >= 0
      ? '移动'
      : vt.indexOf(h1) >= 0
      ? '虚拟运营商'
      : false
    : false;
  return x;
};
